Public Class View_Factory
    Public Enum SORT As Integer
        DATE_ASC = 1
        DATE_DESC = 2
        VER_ASC = 3
        VER_DESC = 4
        NAME_ASC = 5
        NAME_DESC = 6
    End Enum

    Public Function GetAllViewsForDatabase( _
                        ByVal lDatabaseID As Long, _
                        Optional ByVal lSort As SORT = SORT.NAME_ASC) As Collection

        Dim oFactory As New DBView_Factory
        Return oFactory.GetAllViewsForDatabase(lDatabaseID, lSort)
    End Function

    Public Function GetAllViewsForDatabase( _
                        ByVal lDatabaseID As Long, _
                        ByVal lDatabaseRevID As Long, _
                        Optional ByVal lSort As SORT = SORT.NAME_ASC) As Collection

        Dim oFactory As New DBView_Factory
        Return oFactory.GetAllViewsForDatabase(lDatabaseID, lDatabaseRevID, lSort)
    End Function

    Public Function GetAllViewsForDatabase( _
                    ByVal lDatabaseID As Long, _
                    ByVal sStartDate As String, _
                    ByVal sEndDate As String, _
                    ByVal lSort As View_Factory.SORT) As Collection

        Dim oFactory As New DBView_Factory
        Return oFactory.GetAllViewsForDatabase(lDatabaseID, sStartDate, sEndDate, lSort)
    End Function

    Public Function GetViewByName( _
                        ByVal lDatabaseID As Long, _
                        ByVal lOwnerID As Long, _
                        ByVal sView As String) As SQLAutoDocLib.View

        Dim oFactory As New DBView_Factory
        Return oFactory.GetViewByName(lDatabaseID, lOwnerID, sView)
    End Function

    Public Function GetAllViewRevs( _
        ByVal lViewID As Long) As ArrayList

        Dim oFactory As New DBView_Factory
        Return oFactory.GetAllViewRevs(lViewID)
    End Function

    Public Function FindViews( _
            ByVal lServerID As Long, _
            ByVal lDatabaseID As Long, _
            ByVal sStartDate As String, _
            ByVal sEndDate As String, _
            ByVal sSearchText As String) As ArrayList

        Dim oFactory As New DBView_Factory
        Return oFactory.FindViews(lServerID, lDatabaseID, sStartDate, sEndDate, sSearchText)
    End Function

    Public Function CountOfActiveViewsForDatabase(ByVal lDatabaseID As Long)
        Dim oFactory As New DBView_Factory
        Return oFactory.CountOfActiveViewsForDatabase(lDatabaseID)
    End Function
End Class
